/*
 * @Author: mikey.zhaopeng 
 * @Date: 2018-12-17 22:29:35 
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2018-12-17 22:38:35
 */
import 'package:flutter/material.dart';

class Tag extends StatelessWidget{
  final String text;
  final Color backgroundColor;
  final Color color;
  final bool border;

  Tag({Key key,this.text,this.backgroundColor,this.color =Colors.black,this.border =false}):super(key:key);

  @override
  Widget build(BuildContext context){
    return ConstrainedBox(
      constraints: BoxConstraints(maxWidth: 120.0),
      child: Container(
        padding: const EdgeInsets.symmetric(horizontal: 16.0,vertical: 4.0),
        decoration: BoxDecoration(
          color: backgroundColor,
          borderRadius: BorderRadius.circular(20.0),
          border: border?Border.all(color: color,width: 1.0):null
        ),
        child: Text(
          text,
          maxLines: 1,
          overflow: TextOverflow.ellipsis,
          textAlign: TextAlign.center,
          style:TextStyle(
            fontSize:10.0,
            color:color
          )
        ),
      ),
    );
  }
}